
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>后台</title>

    <link href="__PUBLIC__/images/favicon.ico" rel="shortcut icon" />

    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-theme.min.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/dashboard.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-switch.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/icheck/all.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-datetimepicker.css" />
    <style>
        .datetimepicker.quarter .month {
            width: 48%;
        }
        .datetimepicker.quarter .month:nth-child(n+5){
            display: none;
        }
    </style>

</head>

<body>

<include file="Common/topNav" />

<div class="container-fluid">
    <div class="row">
        <include file="Common/leftMenu" />
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <!--标题头-->
            <div class="cont-title clearfix">
                <div class="title">税收异常列表</div>
                <div class="btn-group">

                </div>
            </div>
            <!--搜索模块-->
            <form class="jc-search form-inline searchForm" method="post" action="{:U('Admin/Tax/exception')}" id="searchForm">
                <div class="form-group">
                    <label>纳税年份:</label>
                    <select class="form-control" name="year">
                    <volist name="yearOption" id="item">
                        <option value="{$item}" <if condition="$year eq $item">selected</if>>{$item}年</option>
                    </volist>
                    </select>
                </div>
                <div class="form-group">
                    <label>纳税季度:</label>
                    <select class="form-control" name="season" id="season">
                        <option value="">--请选择--</option>
                        <option value="一季度" <if condition="$season eq '一季度'">selected</if>>一季度</option>
                        <option value="二季度" <if condition="$season eq '二季度'">selected</if>>二季度</option>
                        <option value="三季度" <if condition="$season eq '三季度'">selected</if>>三季度</option>
                        <option value="四季度" <if condition="$season eq '四季度'">selected</if>>四季度</option>

                    </select>
                    <!--<div class='input-group date col-sm-7' id='datetimepicker'>-->
                        <!--<input type='text' value="{$taxDate}" name="season_date" class="form-control " data-date-format="yyyy/M" id="season_date"/>-->

                    <!--</div>-->
                </div>
                <div class="form-group">
                    <label>预警分类 :</label>
                    <select class="form-control" name="type" id="type">
                        <option value="" >全部</option>
                        <option value="1" <if condition="$type eq '1'">selected</if>>同比</option>
                        <option value="2" <if condition="$type eq '2'">selected</if>>环比</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>关键字 :</label>
                    <input type="text" class="form-control" name="keywords" value="{$_POST['keywords']}" placeholder=" 输入企业名称 ">
                </div>
                <button type="button" id="search" class="btn">搜索</button>
            </form>
            <!--表格-->
            <div class="table-responsive">
                <table class="table table-striped table-hover" id="tableData">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>企业名称</th>
                        <th>分类</th>
                        <th>营业额（万元）</th>
                        <th>纳税额（万元）</th>
                        <th>纳税日期</th>
                        <th>国税局</th>
                        <th>地税局</th>
                        <th>所属街道</th>
                        <th>所属楼宇</th>
                        <th>所属行业</th>
                        <th>备  注</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="taxList['list']" id="tax">
                        <tr>
                            <td>{$key|getLineNum=$nowPage,$pageSize}</td>
                            <td> <div style="width:124px; height:20px; overflow:hidden;"><a href="#" title="{$tax.company_name}" style="color:#000; text-decoration:none;">{$tax.hover_company_name}</a></div></td>
                            <td><if condition="$tax['type'] eq 1">公司
                                <elseif condition="$tax['type'] eq 2"/>分公司
                                <elseif condition="$tax['type'] eq 3"/>办事处
                                <elseif condition="$tax['type'] eq 4"/>个体
                                <else/>无照
                            </if></td>
                            <td>{$tax.turnover|number_format=2}</td>
                            <td>{$tax.tax_amount|number_format=2}</td>
                            <td>{$tax.tax_date}</td>
                            <td>{$tax.tax_department}</td>
                            <td>{$tax.local_tax_department}</td>
                            <td>{$tax.org_name}</td>
                            <td>{$tax.house_name}</td>
                            <td>{$tax.industry_name}</td>
                            <td>
                                <div style="width:124px; height:20px; overflow:hidden;"><a href="#" title="{$tax.market}" style="color:#000; text-decoration:none;">{$tax.hover_market}</a></div>
                            </td>
                        </tr>
                    </volist>
                    </tbody>
                </table>
                <div class="page">
                    {$taxList.page}
                </div>
            </div>

        </div>
    </div>
</div>
<include file="Common/modalHtmls" />
<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/bootstrap-switch.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/icheck.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/validator.min.js"></script>

<script type="text/javascript" src="__PUBLIC__/js/jquery-upload/js/vendor/jquery.ui.widget.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-upload/js/jquery.fileupload.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-upload/js/jquery.fileupload-ui.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-upload/js/jquery.iframe-transport.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery-upload/js/jquery.fileupload-process.js"></script>
<script>
    $.fn.datetimepicker.dates['zh-CN-qtrs'] = {
        days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
        daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
        daysMin:  ["日", "一", "二", "三", "四", "五", "六", "日"],
        months: ["Q1", "Q2", "Q3", "Q4", "", "", "", "", "", "", "", ""],
        monthsShort: ["一季度", "二季度", "三季度", "四季度", "", "", "", "", "", "", "", ""],
        clear: "清除",
        meridiem: ["上午", "下午"]
    };
    var date = new Date();
    date.setDate(1);
    date.setMonth(Math.floor(date.getMonth() / 3));
    $('#season_date').each(function(idx, elem) {
        var that = $(this);
        that.datetimepicker({
            clearBtn:true,
            startView:3,
            minView:3,
            format:'yyyy/M',
            language:'zh-CN-qtrs',
            initialDate: date
        });
        that.data('datetimepicker').picker.addClass('quarter');
    });
    $("#tableData .editCompany").click(function () {
        var companyId = $(this).attr("companyId");
        common.htmlAjax("{:U('Admin/Company/editCompany')}", {companyId: companyId}, function (html) {
            $("#commonModal").html(html).modal({show: true, backdrop: 'static', keyboard: false});
        })
    })

    $("#companyAdd").click(function () {
        common.htmlAjax("{:U('Admin/Company/addCompany')}", {}, function (html) {
            $("#commonModal").html(html).modal({show: true, backdrop: 'static', keyboard: false});
        })
    })

    $("#tableData .delTax").click(function(){
        var id = $(this).attr("companyId");
        common.confirm("提示","确定删除该税收记录?",function(){
            common.ajax("{:U('Admin/Tax/delTax')}",{taxId:id},function(data){
                common.alert("提示","该税收记录删除成功!",function(){
                    common.reload();
                });
            })
        })
    });
    $("#tableData .detailCompany").click(function () {
        var companyId = $(this).attr("companyId");
        common.htmlAjax("{:U('Admin/Company/info')}", {companyId: companyId}, function (html) {
            $("#commonModal").html(html).modal({show: true, backdrop: 'static', keyboard: false});
        })
    })

    $("#search").click(function () {
        if($("#type").val() == "2" && $("#season").val() == "") {
            common.alert("提示","请选择纳税季度");
            return false;
        }
        $('#searchForm').submit()
    })

    $("#load").click(function () {
        common.htmlAjax("{:U('Admin/Tax/load')}", {}, function (html) {
            $("#commonModal").html(html).modal({show: true, backdrop: 'static', keyboard: false});
        })
    })

</script>
</body>
</html>
